//收集表单里的值，提交给修改密码的接口即可
$('.layui-form').on('submit', function (ev) {
    ev.preventDefault();
    var data = {
        oldPwd: md5($('.layui-form input[name=oldPwd]').val()),
        newPwd: md5($('.layui-form input[name=newPwd]').val()),
    }
    var arr = [];
    for (var prop in data) {
        arr.push(`${prop}=${data[prop]}`);
    }
    var argStr = arr.join('&');
    rePassAPI(argStr, function (res) {
        console.log(res);
        window.parent.sessionStorage.removeItem('token');
        window.parent.location.href = '/login.html';
    })
})